class Watcher{
    constructor(callback){
        this.callback=callback;
    }
    update(){
        this.callback();
    }
}

const watcher=new Watcher(function(){
    console.log('监视器回调方法被执行了');
});